#include "widget.h"

#include <QApplication>
//列表框界面优化
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    //当鼠标进入选项中时
    QString style="QListWidget::item:hover { background-color:qlineargradient(x1:0,y1:0,x2:1,y2:1,stop:0 red,stop:1 blue);}";
    //当鼠标选中选项时
    style+="QListWidget::item:selected { background-color:qlineargradient(x1:0,y1:1,x2:1,y2:0,stop:0 blue,stop:1 green); }";
    //设置到全局QSS
    a.setStyleSheet(style);
    Widget w;
    w.show();
    return a.exec();
}
